package com.mapfinal.server.service.tile;

import com.jfinal.kit.StrKit;
import com.lambkit.web.controller.LambkitController;

/**
 * 地图瓦片
 * @author yangyong
 *
 */
public class TileController extends LambkitController {

	public void index() {
		String serverType = get("type");
		String server = getPara("server");
		String layer = getPara("layer");
		
		String crs = getPara("crs", "EPSG:3857");
		Integer zoom = getParaToInt("z");
		Integer x = getParaToInt("x");
		Integer y = getParaToInt("y");
		String time = getPara("time");
		String styles = getPara("styles", "");
		String pathName = getPara("pn");
		TileParam tile = new TileParam(x, y, zoom, crs);
		if (StrKit.isBlank(pathName) && StrKit.notBlank(time)) {
			pathName = time;
		}
		if(StrKit.notBlank(serverType)) {
			tile.setServerType(serverType);
		}
		tile.setServer(server);
		tile.setLayer(layer);
		tile.setStyles(styles);
		tile.setPathName(pathName);
		
		//获取layer
		
		//获取datastore
		
		//获取数据源
		
		//数据转换
		
		//数据渲染
		
		//返回
	}
}
